package com.ftg.product.login.service;


import com.ftg.product.login.mapper.LoginMapper;
import com.ftg.product.login.pojo.Admin;
import com.ftg.product.login.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class LoginService {
    @Autowired
    LoginMapper lm;
    public boolean show(Admin admin) {
        List<Map<String, Object>> list =lm.show(admin);
        if(list.isEmpty()||list == null) {
            //不存在
            return false;
        }else if(list.size() == 1) {
            //存在正确
            return true;
        }else {
            //
            return false;
        }

    }

    public boolean showall(User user) {
        List<Map<String, Object>> list =lm.showall(user);
        if(list.isEmpty()||list == null) {
            //不存在
            return false;
        }else if(list.size() == 1) {
            //存在正确
            return true;
        }else {
            //
            return false;
        }

    }

}


